package three;

/**
 * 定义一个人类，包括属性：姓名、性别、年龄、国籍；包括方法：吃饭、睡觉，工作。
 * 
 * （1）根据人类，派生一个学生类，增加属性：学校、学号；重写工作方法（学生的工作是学习）。
 * 
 * （2）根据人类，派生一个工人类，增加属性：单位、工龄；重写工作方法（工人的工作是……自己想吧）。
 * 
 * （3）根据学生类，派生一个学生干部类，增加属性：职务；增加方法：开会。
 * 
 * （4）编写主函数分别对上述3类具体人物进行测试。
 * 
 * @author Lenovo
 *
 */
public class Test {

}

class People {
	private String name;// 姓名
	private String sex;// 性别
	private int age;// 年龄
	private String nationality;// 国籍
	public People(String name, String sex, int age, String nationality) {
		this.name = name;
		this.sex = sex;
		this.age = age;
		this.nationality = nationality;
	}
	public String getName() {
		return name;
	}
	public void setName(String name) {
		this.name = name;
	}
	public String getSex() {
		return sex;
	}
	public void setSex(String sex) {
		this.sex = sex;
	}
	public int getAge() {
		return age;
	}
	public void setAge(int age) {
		this.age = age;
	}
	public String getNationality() {
		return nationality;
	}
	public void setNationality(String nationality) {
		this.nationality = nationality;
	}
	
	public void sleep() {
		System.out.println("睡觉");
	}
	
	public void eat() {
		System.out.println("吃吃吃吃");
	}
	
	public void work() {
		System.out.println("工作工作");
	}
}

class Student extends People{
	private String school;// 学校
    private String stuNo; //学号
	public Student(String name, String sex, int age, String nationality, String school, String stuNo) {
		super(name, sex, age, nationality);
		this.school = school;
		this.stuNo = stuNo;
	}
	public String getSchool() {
		return school;
	}
	public void setSchool(String school) {
		this.school = school;
	}
	public String getStuNo() {
		return stuNo;
	}
	public void setStuNo(String stuNo) {
		this.stuNo = stuNo;
	}
	
	@Override
	public void work() {
		System.out.println("学习");
	}
}

class Worker extends People{
	private String company;//单位
	private int workAge;//工龄
	public Worker(String name, String sex, int age, String nationality, String company, int workAge) {
		super(name, sex, age, nationality);
		this.company = company;
		this.workAge = workAge;
	}
	public String getCompany() {
		return company;
	}
	public void setCompany(String company) {
		this.company = company;
	}
	public int getWorkAge() {
		return workAge;
	}
	public void setWorkAge(int workAge) {
		this.workAge = workAge;
	}
	
	@Override
	public void work() {
		System.out.println("面试造火箭，工作拧螺丝");
	}
	
}

/**
 * 干部类
 * @author Lenovo
 *
 */
class LoaderStudent extends Student{
	private String worker;

	public LoaderStudent(String name, String sex, int age, String nationality, String school, String stuNo,
			String worker) {
		super(name, sex, age, nationality, school, stuNo);
		this.worker = worker;
	}

	public String getWorker() {
		return worker;
	}

	public void setWorker(String worker) {
		this.worker = worker;
	}
	
	public void meet() {
		System.out.println("开会");
	}
	
	
	
}
